package com.jieshuibao.service;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.jieshuibao.mapper.AnswerUserMapper;
import com.jieshuibao.mapper.DutyMapper;
import com.jieshuibao.model.db.Duty;
import com.jieshuibao.util.StringUtils;

@Service
public class CounselorDutyService {
	@Resource
	private DutyMapper dutyMapper;
	
	@Resource
	private AnswerUserMapper answerUserMapper;
	
	public Duty getDutyById(String id){
		return dutyMapper.selectByPrimaryKey(id);
		
	}
	
	
	
	/**
	 * 获取咨询师职责名字
	 * dutyId   职责id  多个以逗号隔开
	 */
	public String getCounselorDutyName(String dutyId){
		if (StringUtils.isNotBlank(dutyId)) {
			
			 dutyId = "\""+dutyId.replace(",", "\",\"")+"\"";
			String selectDutyName = answerUserMapper.selectDutyName(dutyId);
			return selectDutyName;
		}else {
			return null;
		}
		
	}
}
